home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Adobe Graphics & Publishing SDK 1996 December
/
Adobe Graphics & Publishing SDK 1996 December.iso
/
mac
/
After Effects 3.1 SDK Mac
/
Examples
/
Header Files
/
AE_EffectUI.h
< prev
next >
Wrap
Text File
|
1996-06-19
|
11KB
|
426 lines
/** AE_EffectUI.h
After Effects¬ Custom UI-Related Structure Header File.
Part of the Adobe After Effects 3.1 SDK.
Copyright (c) 1992-96 Adobe Systems Inc.
All Rights Reserved.
NOTES
This file describes the structures and callbacks a plug-in can use
if it wishes to present a custom user interface.
6/12/96 ba Updated for After Effects 3.1.
**/
#ifndef _H_AE_EffectUI
#define _H_AE_EffectUI
#include "AE_Effect.h"
#if PRAGMA_ALIGN_SUPPORTED
#pragma options align=mac68k
#endif
EXTERN_C_START
/** PF_CustomFlags
Kinds of events and actions the custom parameter type might require.
**/
enum {
PF_CustomEFlag_NONE = 0,
PF_CustomEFlag_COMP = 1L << 0,
PF_CustomEFlag_LAYER = 1L << 1,
PF_CustomEFlag_EFFECT = 1L << 2,
PF_CustomEFlag_PREVIEW = 1L << 3
};
typedef long PF_CustomEventFlags;
/** PF_WindowType
The various AE windows which can have custom UI events.
**/
enum {
PF_Window_NONE = -1,
PF_Window_COMP,
PF_Window_LAYER,
PF_Window_EFFECT,
PF_Window_PREVIEW
};
typedef long PF_WindowType;
/** PF_EventType
The event type identifies the kind of UI event that has just taken place.
**/
enum {
PF_Event_NONE = -1,
PF_Event_NEW_CONTEXT,
PF_Event_ACTIVATE,
PF_Event_DO_CLICK,
PF_Event_DRAG,
PF_Event_DRAW,
PF_Event_DEACTIVATE,
PF_Event_CLOSE_CONTEXT,
PF_Event_IDLE,
PF_Event_KEYDOWN,
PF_Event_NUM_EVENTS
};
typedef long PF_EventType;
/**
Depending on the kind of event, the PF_EventUnion parameter will indicate more
information about the event. Here are the 3 kinds of user events.
**/
typedef struct {
unsigned long when;
Point screen_point;
long num_clicks;
long modifiers;
long continue_refcon[4]; /* <> if send_drag is TRUE, set this */
Boolean send_drag; /* << set this from a do_click to get a drag */
Boolean last_time; /* >> set the last time you get a drag */
} PF_DoClickEventInfo;
typedef struct {
Rect update_rect; // in window's coordinate system
long depth;
void *gdeviceH;
} PF_DrawEventInfo;
typedef struct { // effect should only eat keys when modal!
unsigned long when;
Point screen_point;
long char_code;
long key_code;
long modifiers;
} PF_KeyDownEvent;
typedef union {
PF_DoClickEventInfo do_click; // also drag
PF_DrawEventInfo draw;
PF_KeyDownEvent key_down;
// add other event types here
} PF_EventUnion;
#define PF_CONTEXT_MAGIC 0x05ea771e
/** PF_Context
The PF_Context structure is returned in the PF_EventExtra structure and is used
to identify the context (or window) where the UI event is happening. Most fields
are read-only.
**/
typedef struct {
unsigned long magic;
PF_WindowType w_type; // Identifies the AE window context (see above)
void *cgrafptr;
long reserved_flt;
long plugin_state[4];/* A plug-in can store state data specific to a
given context here if it wishes */
} PF_Context, *PF_ContextPtr, **PF_ContextH;
/** PF_EventCallBacks
Here are the custom UI callbacks. The functions defined in this block are:
layer_to_comp
This transforms layer window coordinates to the composition window coordinates.
comp_to_layer
This transforms composition window coordinates to the layer window coordinates.
get_comp2layer_xform
This returns the transformation matrix used to convert from the composition window
to the layer window.
get_layer2comp_xform
This returns the transformation matrix used to convert from the layer window
to the composition window.
source_to_frame
This transforms the source coordinates of the given context to screen coordinates.
frame_to_source
This transforms screen coordinates to the source coordinates of the given context.
info_draw_color
This performs the standard color information reporting into the info window which
happens as the user moves the mouse over the composition window.
info_draw_text
This displays the given text in the info window when an object is selected in the
comp window.
info_get_port
This returns the Macintosh grafptr for the info window so you can draw whatever
you want into it.
**/
typedef struct {
void *refcon; // front-end's refcon
PF_Err (*layer_to_comp)(
void *refcon, /* >> */
PF_ContextH context, /* >> */
long curr_time, /* >> */
long time_scale, /* >> */
PF_FixedPoint *pt); /* << */
PF_Err (*comp_to_layer)(
void *refcon, /* >> */
PF_ContextH context, /* >> */
long curr_time, /* >> */
long time_scale, /* >> */
PF_FixedPoint *pt); /* << */
PF_Err (*get_comp2layer_xform)(
void *refcon, /* >> */
PF_ContextH context, /* >> */
long curr_time, /* >> */
long time_scale, /* >> */
long *exists, /* << non-zero if exists */
PF_FloatMatrix *c2l); /* << */
PF_Err (*get_layer2comp_xform)(
void *refcon, /* >> */
PF_ContextH context, /* >> */
long curr_time, /* >> */
long time_scale, /* >> */
PF_FloatMatrix *l2c); /* << */
PF_Err (*source_to_frame)(
void *refcon, /* >> */
PF_ContextH context, /* >> */
PF_FixedPoint *pt); /* << */
PF_Err (*frame_to_source)(
void *refcon, /* >> */
PF_ContextH context, /* >> */
PF_FixedPoint *pt); /* << */
PF_Err (*info_draw_color)(
void *refcon, /* >> */
PF_Pixel color); /* >> */
PF_Err (*info_draw_text)(
void *refcon, /* >> */
char *text1, /* >> Cstring */
char *text2); /* >> Cstring */
PF_Err (*info_get_port)(
void *refcon, /* >> */
void **cgrafptr_addr); /* << */
} PF_EventCallbacks, *PF_EventCallbacksPtr;
enum {
PF_EA_NONE = 0,
PF_EA_PARAM_TITLE,
PF_EA_CONTROL
};
typedef long PF_EffectArea;
/** PF_EffectWindowInfo
If an event takes place in an effects window, the following structure will be sent in
the PF_EffectWindowInfo field.
**/
typedef struct {
PF_ParamIndex index; // identifies which control is being affected
PF_EffectArea area; // indicates the control or control title
Rect current_frame; // full frame of the current area
Rect param_title_frame; // full frame of the param title area
long horiz_offset; // h offset to draw into title
} PF_EffectWindowInfo;
/** PF_EventOutFlags
Event Output Flags. This currently only contains one value which you can set. Setting it
indicates to After Effects that you╒ve handled an event which shouldn╒t be further propagated.
**/
enum {
PF_EO_NONE = 0,
PF_EO_HANDLED_EVENT = 1L << 0
};
typedef long PF_EventOutFlags;
/** PF_EventInFlags
Event Input Flags. This currently contains only one value, which you should examine before
drawing into a comp or layer window. If this flag is set you should avoid drawing
**/
enum {
PF_EI_NONE = 0,
PF_EI_DONT_DRAW = 1L << 0 // don't draw controls in comp or layer window
};
typedef long PF_EventInFlags;
/** PF_EventExtra
Upon receiving the PF_Cmd_EVENT command selector, the *extra parameter will point to the
following structure which describes the UI event.
**/
typedef struct {
PF_ContextH contextH; /* >> */
PF_EventType e_type; /* >> */
PF_EventUnion u; /* >> based on e_type */
PF_EffectWindowInfo effect_win; /* >> only for Effect window do_click and draw */
PF_EventCallbacks cbs; /* >> not for new_context or close_context */
PF_EventInFlags evt_in_flags; /* >> */
PF_EventOutFlags evt_out_flags; /* << */
} PF_EventExtra;
typedef struct {
PF_ParamIndex index; /* which parameter is this? */
unsigned long ntrp; /* 0 .. 0xffffffff, btw left_key and right_key */
PF_ParamDefPtr left_key; /* >> */
PF_ParamDefPtr right_key; /* >> */
void *stream;
void *refcon;
long time_value;
unsigned long time_scale;
PF_ParamDefPtr result; /* << already allocated */
} PF_NtrpExtra;
typedef struct {
long maj_vers;
long min_vers;
PF_ParamList old_params;
} PF_ConvertParamsExtra;
typedef struct {
char name[ PF_MAX_EFFECT_NAME_LEN + 1 ];
char category[ PF_MAX_EFFECT_CATEGORY_NAME_LEN + 1 ];
PF_SpecVersion spec_version; /* PF version effect was built with */
PF_OutFlags global_outflags;
} PF_PiPLExtra;
enum {
PF_UIAlignment_NONE = 0,
PF_UIAlignment_TOP = 1L << 0,
PF_UIAlignment_LEFT = 1L << 1,
PF_UIAlignment_BOTTOM = 1L << 2,
PF_UIAlignment_RIGHT = 1L << 3
};
typedef long PF_UIAlignment;
struct _PF_CustomUIInfo {
long reserved;
PF_CustomEventFlags events;
long comp_ui_width;
long comp_ui_height;
PF_UIAlignment comp_ui_alignment;
long layer_ui_width;
long layer_ui_height;
PF_UIAlignment layer_ui_alignment;
long preview_ui_width;
long preview_ui_height;
PF_UIAlignment preview_ui_alignment;
};
/** ---------- Callback Access Macros ----------
Each of these macros _ASSUMES_ you already have a local named "extra".
In addition, the macros assume you want to operate on the current context
and not some other one. We know these are heinous assumption, but the
template code declares the parameters like that, and by making those
assumptions, we can simplify these macros.
The prototypes and comments about each function are given above in
the PF_EventCallbacks structure definition.
**/
#define PF_LAYER_TO_COMP(CURR_TIME, TIMESCALE, PT) \
((extra)->cbs.layer_to_comp((extra)->cbs.refcon, (extra)->context, \
(CURR_TIME), (TIME_SCALE), (PT)))
#define PF_COMP_TO_LAYER(CURR_TIME, TIMESCALE, PT) \
((extra)->cbs.comp_to_layer((extra)->cbs.refcon, (extra)->context, \
(CURR_TIME), (TIME_SCALE), (PT)))
#define PF_GET_COMP2LAYER_XFORM(CURR_TIME, TIMESCALE, EXISTS, C2L) \
((extra)->cbs.get_comp2layer_xform((extra)->cbs.refcon, (extra)->context, \
(CURR_TIME), (TIME_SCALE), (EXISTS), (C2L)))
#define PF_GET_LAYER2COMP_XFORM(CURR_TIME, TIMESCALE, L2C) \
((extra)->cbs.get_layer2comp_xform((extra)->cbs.refcon, (extra)->context, \
(CURR_TIME), (TIME_SCALE), (PT)))
#define PF_SOURCE_TO_FRAME(PT) \
((extra)->cbs.source_to_frame((extra)->cbs.refcon, (extra)->context, \
(PT)))
#define PF_FRAME_TO_SOURCE(PT) \
((extra)->cbs.frame_to_source((extra)->cbs.refcon, (extra)->context, \
(PT)))
#define PF_INFO_DRAW_COLOR(COLOR) \
((extra)->cbs.info_draw_color((extra)->cbs.refcon, \
(COLOR)))
#define PF_INFO_DRAW_TEXT(TEXT1, TEXT2) \
((extra)->cbs.info_draw_text((extra)->cbs.refcon, \
(TEXT1) (TEXT2)))
#define PF_INFO_GET_PORT(CGRAFPTR_ADDR) \
((extra)->cbs.info_get_port((extra)->cbs.refcon, \
(CGRAFPTR_ADDR)))
EXTERN_C_END
#if PRAGMA_ALIGN_SUPPORTED
#pragma options align=reset
#endif
#endif /* _H_AE_EffectUI */